var tipopersonas = {
		init:function(){
	$('#tipopersonas').jqGrid({
	           url:'tipopersonas/index',
	           datatype:'json',
	           mtype:'POST',
	           colNames:['id','Descripcion','Creado','Estado'],
	           colModel:[
	               {name:"data[Tipopersona][id]",hidden:true},
	               {name:"data[Tipopersona][descripcion]",index:'Tipopersona.descripcion',width:250,align:'left',sortable:true,editoptions:{maxlength:250, size:30},editable:true,editrules:{required:true},searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
	               {name:"data[Tipopersona][created]",index:'Tipopersona.created',width:60,align:'left',sortable:true,editable:false,searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
	               {name:"data[Tipopersona][estado_id]",
				   		index:'Tipopersona.descripcion',
						width:60,
						align:'left',
						editable: true,
						edittype:"select",
						editrules:{required:true},
						editoptions:{
							value:"1:Activo;2:Desactivo"
						},
						searchoptions:{
							sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']
						}
					}               
	           ],
		
			   pager:$('#tipopersonas-pager'),
	           rowNum:10,
	           rownumbers: true, 
	           rowList:[10,20,30],
	           mtype: "POST",
	           viewrecords:true,
	           caption:'Tipopersonas',
	           height:'180',
			   //width
	           sortname: "Tipopersona.descripcion",
	           editurl: 'tipopersonas/index'
	          
	                
	       });
	       $('#tipopersonas').navGrid("#tipopersonas-pager",{edit:true,add:true,del:true},{clearAfterEdit:false,reloadAfterSubmit:true, closeOnEscape:true},{clearAfterAdd:false,reloadAfterSubmit:true, closeOnEscape:true},{width:270,reloadAfterSubmit:true, closeOnEscape:true},{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew'],multipleSearch:true, closeOnEscape:true});
	       $("#tipopersonas").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});
	       jQuery("#tipopersonas").jqGrid('setGridWidth',$('#RightPane').width()-50);
		}
};